﻿package mortal.game.view.guide
{
    import com.gengine.global.*;
    import com.mui.controls.*;
    import extend.language.*;
    import flash.events.*;
    import mortal.common.*;
    import mortal.common.global.*;
    import mortal.component.gconst.*;
    import mortal.component.window.*;
    import mortal.game.manager.*;
    import mortal.game.mvc.*;
    import mortal.game.view.common.*;
    import mortal.mvc.core.*;

    public class GuideEnterCrossNormalTipsWin extends SmallWindow
    {
        private var _timer:SecTimerView;
        private static var _instance:GuideEnterCrossNormalTipsWin;

        public function GuideEnterCrossNormalTipsWin()
        {
            super(LayerManager.windowLayer);
            this.setSize(290, 180);
            this.title = Language.getString(21016);
            return;
        }// end function

        override public function show(param1:int = 0, param2:int = 0) : void
        {
            super.show(param1, param2);
            this.stageResize();
            return;
        }// end function

        private function stageResizeHandler(param1 = null) : void
        {
            this.stageResize();
            return;
        }// end function

        override public function stageResize() : void
        {
            super.stageResize();
            this.x = Global.stage.stageWidth - 312;
            this.y = Global.stage.stageHeight - 260;
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            Dispatcher.addEventListener(EventName.StageResize, this.stageResizeHandler);
            this.mouseEnabled = true;
            this.mouseChildren = true;
            var _loc_1:* = GlobalStyle.textFormatBai;
            var _loc_2:* = UIFactory.gTextField("", 35, 40, 260, 100, this, _loc_1);
            _loc_2.wordWrap = true;
            _loc_2.multiline = true;
            _loc_2.htmlText = Language.getString(21023);
            pushUIToDisposeVec(_loc_2);
            var _loc_3:* = UIFactory.gButton("", 105, 140, 84, 26, this);
            pushUIToDisposeVec(_loc_3);
            _loc_3.configEventListener(MouseEvent.CLICK, this.clickMeHandler);
            _loc_1 = GlobalStyle.textFormatBai;
            _loc_1.size = 12;
            this._timer = UIFactory.secTimeView(Language.getString(21024), _loc_3.x + 5, _loc_3.y + 4, 120, 26, null, _loc_1);
            this._timer.filters = [FilterConst.glowFilter];
            this._timer.mouseEnabled = false;
            this.addChild(this._timer);
            this._timer.setLeftTime(10);
            this._timer.timeOutHandler = this.timeOutHandler;
            return;
        }// end function

        private function timeOutHandler() : void
        {
            this.clickMeHandler(null);
            return;
        }// end function

        private function clickMeHandler(event:MouseEvent) : void
        {
            this.parent.removeChild(this);
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            super.disposeImpl(param1);
            this._timer.stop();
            this._timer.dispose(param1);
            this._timer = null;
            Dispatcher.removeEventListener(EventName.StageResize, this.stageResize);
            return;
        }// end function

        public static function get instance() : GuideEnterCrossNormalTipsWin
        {
            if (_instance == null)
            {
                _instance = new GuideEnterCrossNormalTipsWin;
            }
            return _instance;
        }// end function

    }
}
